package UI;
/**
* 更新位置和分数线程
* */
public class Rethread extends Thread{
    private control mainJpanel;
    public Rethread(control con){
        this.mainJpanel=con;
    }
    @Override
    public void run() {
        while(mainJpanel.all.user.GetLife()>0){
            try {
                Thread.sleep(10);
            } catch (Exception e) {
                e.printStackTrace();
            }
            //更新位置
            mainJpanel.repaint();
            mainJpanel.score.setText("得分："+mainJpanel.all.scores+"  生命"+mainJpanel.all.user.GetLife());
        }
        mainJpanel.all.Is_Start=false;
        mainJpanel.GameOver();
    }

}


